package ar.edu.utn.frba.dds.tp.ui;

import org.uqbar.arena.actions.MessageSend;
import org.uqbar.arena.widgets.Button;
import org.uqbar.arena.widgets.Label;
import org.uqbar.arena.widgets.Panel;
import org.uqbar.arena.windows.MainWindow;

import ar.edu.utn.frba.dds.tp.code.usuarios.UsuarioStandard;

@SuppressWarnings("serial")
public class PrincipalWindow extends MainWindow<UsuarioStandard> {

	public PrincipalWindow() {
		super(new UsuarioStandard());
	}

	@Override
	public void createContents(Panel mainPanel) {
		
		this.setTitle("Aterrizar.Com");
		
		mainPanel.setVerticalLayout();
		
		Panel saludo = new Panel(mainPanel);
		saludo.setHorizontalLayout();
		saludo.setWidth(600);
				
		new Label(saludo).setText("Hola, ");
//		new Label(saludo).bindValueToProperty("nombre");
		
		new Label(mainPanel).setText("¿Que desea hacer?");
		
		Panel botonera = new Panel(mainPanel);
		botonera.setLayoutInColumns(3);
		
		new Button(botonera)
			.setCaption("Ver Compras")
			.onClick(new MessageSend(this, "verCompras"));
		new Button(botonera)
			.setCaption("Ver Reservas")
			.onClick(new MessageSend(this, "verReservas"));
		new Button(botonera)
			.setCaption("Buscar Asientos");
		
		
	}

	//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	//+++ MAIN +++++++++++++++++++++++++++++++++++++++++++++++++++
	//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	
	public static void main(String[] args) {
		new PrincipalWindow().startApplication();
	}
	

}
